package cn.good.yan.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * 负载均衡配置
 *
 * @author shengren.yan
 * @create 2024-02-03
 */
@Configuration
public class ApplicationContextConfig {

    // 负载均衡配置，也可以写在 BootApplication启动类上
    @Bean
    @LoadBalanced
    public RestTemplate getRestTemplate() {
        return new RestTemplate();
    }

}
